this._a11yApplicationsSettings = new Gio.Settings({ schema_id: A11Y_APPLICATIONS_SCHEMA });
this._a11yApplicationsSettings.connect('changed', this._syncEnabled.bind(this));
- this._lastDeviceId = null;
- Meta.get_backend().connect('last-device-changed', (backend, deviceId) => {
- let manager = Clutter.DeviceManager.get_default();
- let device = manager.get_device(deviceId);
-
+ this._lastDevice = null;
+ Meta.get_backend().connect('last-device-changed', (backend, device) => {
if (device.get_device_name().indexOf('XTEST') < 0) {
- this._lastDeviceId = deviceId;
+ this._lastDevice = device;
this._syncEnabled();
}
});
}
_lastDeviceIsTouchscreen() {
- if (!this._lastDeviceId)
- return false;
-
- let manager = Clutter.DeviceManager.get_default();
- let device = manager.get_device(this._lastDeviceId);
-
- if (!device)
+ if (!this._lastDevice)
return false;
- return device.get_device_type() == Clutter.InputDeviceType.TOUCHSCREEN_DEVICE;
+ let deviceType = this._lastDevice.get_device_type();
+ return deviceType == Clutter.InputDeviceType.TOUCHSCREEN_DEVICE;
}
_syncEnabled() {